// createRouter 是一个方法是生成路由实例对象的
// createWebHashHistory用来创建哈希模式的路由对象
import { createRouter, createWebHashHistory } from 'vue-router'
import Layout from '@views/Layout'
import Login from '@/views/Login'
import Category from '@/views/Category'
const routes = [
  {
    path: '/login',
    component: Login
  },
  {
    path: '/',
    component: Layout,
    children: [{
      name: 'category',
      path: 'category/:id',
      component: Category
    }]
  }

]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
